﻿using System;
using System.Collections.Generic;
using HiTeachers.Data.Manager;
using HiTeachers.Entities;
using HiTeachers.Interfaces;

namespace HiTeachers.Services
{
    public class FeeConfigServices
    {
        //private static readonly IFeeConfigDao FeeConfigDao = NHibernateDaoFactory.Instance.GetDao<IFeeConfigDao>("feeConfig");
        private static readonly IFeeConfigDao FeeConfigDao = NHibernateDaoFactory.Instance.GetFeeConfigDao();

        public static FeeConfig GetById(string itemId)
        {
            var guid = new Guid(itemId);

            return FeeConfigDao.GetById(guid, false);
        }

        public static FeeConfig GetByPeriod(int period)
        {
            return FeeConfigDao.GetByPeriod(period);
        }

        public static FeeConfig SaveOrUpdate(FeeConfig feeConfig)
        {
            return FeeConfigDao.SaveOrUpdate(feeConfig);
        }

        public static IList<FeeConfig> GetAll()
        {
            return FeeConfigDao.GetAll();
        }
    }
}
